# Split code and markup

CodeTextSplitter allows you to split your code and markup with support for multiple languages.

LangChain supports a variety of different markup and programming language-specific text splitters to split your text based on language-specific syntax.
This results in more semantically self-contained chunks that are more useful to a vector store or other retriever.
Popular languages like JavaScript, Python, Solidity, and Rust are supported as well as Latex, HTML, and Markdown.

## Usage

Initialize a standard `RecursiveCharacterTextSplitter` with the `fromLanguage` factory method. Below are some examples for various languages.

## JavaScript

import CodeBlock from "@theme/CodeBlock";
import JSExample from "@examples/indexes/javascript_text_splitter.ts";

<CodeBlock language="typescript">{JSExample}</CodeBlock>

## Markdown

import MarkdownExample from "@examples/indexes/markdown_text_splitter.ts";

<CodeBlock language="typescript">{MarkdownExample}</CodeBlock>

## Python

import PythonExample from "@examples/indexes/python_text_splitter.ts";

<CodeBlock language="typescript">{PythonExample}</CodeBlock>

## HTML

import HTMLExample from "@examples/indexes/html_text_splitter.ts";

<CodeBlock language="typescript">{HTMLExample}</CodeBlock>

## Latex

import LatexExample from "@examples/indexes/latex_text_splitter.ts";

<CodeBlock language="typescript">{LatexExample}</CodeBlock>
